public CorrelationListCommand(
RasterImage correlationImage,
LeadPoint[] points,
int[] listIndex,
int xStep,
int yStep,
int threshold
)
- (instancetype)initWithCorrelationImage:(null_unspecified LTRasterImage *)correlationImage points:(nullable NSArray<NSValue *> *)points listIndex:(NSUInteger *)listIndex xStep:(NSUInteger)xStep yStep:(NSUInteger)yStep threshold:(NSUInteger)threshold NS_DESIGNATED_INITIALIZER;
public CorrelationListCommand(
RasterImage correlationImage,
LeadPoint[] points,
int[] listIndex,
int xStep,
int yStep,
int threshold
);
public:
CorrelationListCommand(
RasterImage^ correlationImage,
array<LeadPoint>^ points,
array<int>^ listIndex,
int xStep,
int yStep,
int threshold
)
correlationImage
RasterImage object that references the image(s) for which to search.
points
Array of LeadPoint objects to be updated with the starting points of the correlated areas.
listIndex
Array of integers to be updated with the indices of the images that match correlated areas.
xStep
Step size in the X direction (along image width), in pixels. For best results, use 1.
yStep
Step size in the Y direction (along image height), in pixels. For best results, use 1.
threshold
Value that indicates the correlation threshold, which is a measure of the association necessary for two areas to be considered to be correlated. If the correlation value between an image in the list and an area in the reference image is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).
Run the CorrelationListCommand on an image
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
public void CorrelationListConstructorExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"));
CopyRectangleCommand copyRectangle = new CopyRectangleCommand();
LeadRect rc_cor = new LeadRect(327, 378, 22, 28);
copyRectangle.Rectangle = rc_cor;
copyRectangle.Run(image);
RasterImage correlationImage = copyRectangle.DestinationImage.Clone();
rc_cor = new LeadRect(283, 378, 22, 28);
copyRectangle.Rectangle = rc_cor;
copyRectangle.Run(image);
correlationImage.AddPage(copyRectangle.DestinationImage.Clone());
LeadPoint[] points = new LeadPoint[30];
int[] listIndex = new int[30];
CorrelationListCommand command = new CorrelationListCommand(correlationImage, points, listIndex, 1, 1, 90);
command.Run(image);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
import java.io.File;
import java.io.IOException;
import org.junit.*;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import static org.junit.Assert.*;
import leadtools.*;
import leadtools.codecs.*;
import leadtools.imageprocessing.CopyRectangleCommand;
import leadtools.imageprocessing.core.CorrelationListCommand;
public void correlationListConstructorExample() {
final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images";
final String outputFileName = combine(LEAD_VARS_IMAGES_DIR, "cleanResultConstruct.tif");
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.setThrowExceptionsOnInvalidImages(true);
RasterImage image = codecs.load(combine(LEAD_VARS_IMAGES_DIR, "clean.tif"));
CopyRectangleCommand copyRectangle = new CopyRectangleCommand();
LeadRect rc_cor = new LeadRect(327, 378, 22, 28);
copyRectangle.setRectangle(rc_cor);
copyRectangle.run(image);
RasterImage correlationImage = copyRectangle.getDestinationImage().clone();
rc_cor = new LeadRect(283, 378, 22, 28);
copyRectangle.setRectangle(rc_cor);
copyRectangle.run(image);
correlationImage.addPage(copyRectangle.getDestinationImage().clone());
LeadPoint[] points = new LeadPoint[30];
int[] listIndex = new int[30];
CorrelationListCommand command = new CorrelationListCommand(correlationImage, points, listIndex, 1, 1, 90);
command.run(image);
codecs.save(image, outputFileName, RasterImageFormat.JPEG, 0);
assertTrue(new File(outputFileName).exists());
System.out.println("File saved to: " + outputFileName);
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document